Skip to content

ci: pin integration tests to Cacti 1.2.31 - #225

Open
somethingwithproof wants to merge 12 commits into
Cacti:developfrom
somethingwithproof:ci/monitor-workflow-hardening
Open

ci: pin integration tests to Cacti 1.2.31#225
somethingwithproof wants to merge 12 commits into
Cacti:developfrom
somethingwithproof:ci/monitor-workflow-hardening

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Jul 13, 2026

Copy link
Copy Markdown
Member

Pins the Cacti checkout used by the integration workflow to release/1.2.31, so CI exercises the declared 1.2.31 compatibility contract instead of a moving development branch.

The branch carries the rest of the workflow cleanup with it:

  • rename the workflow to Monitor CI, add path filters, workflow_dispatch, a contents: read permissions block and a concurrency group
  • pin actions/checkout, shivammathur/setup-php and actions/upload-artifact to commit SHAs
  • bump the MariaDB service from 10.6 to 10.11. 10.6 reached end of life on 2026-07-06 and 10.11 is the current LTS
  • grant the Cacti database user as 'cactiuser'@'%'. The service container publishes a port, so Cacti connects from the Docker gateway address and matches @'%', not @'localhost', which left mysql.time_zone_name unreadable
  • drop the ~/.my.cnf file and use MYSQL_PWD with explicit --host and --user
  • skip vendor/ in the plugin syntax check and fail on the first error rather than on a grep of the output
  • guard the optional .phpstan.neon, include/vendor/bin and composer run-script lint/phpcsfixer steps so a missing file no longer aborts the job
  • upload log/cacti.log as an artifact when a job fails

Validation: actionlint reports nothing on the workflow. A local mariadb:10.11 container with the same service environment confirms an external TCP connection matches 'cactiuser'@'%', that the old @'localhost' grant left mysql.time_zone_name denied, and that the corrected grant makes it readable.

Closes #230

somethingwithproof and others added 11 commits July 12, 2026 13:54
Pin actions/checkout (v5), shivammathur/setup-php (v2) and actions/upload-artifact (v4) to full commit SHAs with a trailing # vX comment. Mutable tags let a compromised or force-pushed tag run arbitrary code in CI; pinning to an immutable SHA is the supply-chain-hardening best practice and matches the SHA-pinned checkout used in the core security workflow.
Keep 1.2.31 pin while covering mid-stream PHP releases.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof added a commit to somethingwithproof/plugin_monitor that referenced this pull request Aug 18, 2026
The plugin shipped three test files that nothing ran: the workflow had no
reference to tests/ at all, so a suite covering request-variable output
escaping sat unexecuted.

Adopts the Pest-through-composer pattern from thold and mactrack, with a
bootstrap that stubs Cacti so plugin code loads without a full install. Two of
the three existing files were meaningful grep guards against raw request reuse
and are kept as Pest datasets; the third only asserted that htmlspecialchars()
works.

Pest 2 rather than mactrack's Pest 1, which no longer runs on current PHP. The
PHP 8.0 runtime floor is enforced by the syntax-floor job rather than a
composer platform pin, since the dev tooling needs 8.1.

Stacked on Cacti#225, so the SHA pinning and permissions block are inherited rather
than duplicated. Dependabot is left to Cacti#226.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof marked this pull request as ready for review August 29, 2026 05:53
@somethingwithproof
somethingwithproof requested a lite review from Copilot September 5, 2026 01:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The workflow introduces additional environment/DB-auth changes beyond the stated scope (notably the MariaDB version bump and grants to cactiuser@localhost despite TCP DB connections), which could break or materially change CI behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the GitHub Actions integration workflow for the Monitor plugin, primarily to run CI against the pinned Cacti release/1.2.31 branch so the workflow tests the declared compatibility contract instead of a moving ref.

Changes:

  • Pin the Cacti checkout in CI to release/1.2.31.
  • Harden CI workflow execution (pinned action SHAs, concurrency/permissions, artifact upload on failure) and adjust bootstrap/lint steps.
File summaries
File Description
.github/workflows/plugin-ci-workflow.yml Pins Cacti checkout to release/1.2.31 and adjusts CI triggers/bootstrap/lint behavior for integration testing.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/plugin-ci-workflow.yml Outdated
Comment thread .github/workflows/plugin-ci-workflow.yml
Comment thread .github/workflows/plugin-ci-workflow.yml
The service container publishes a port, so Cacti reaches MariaDB from the
Docker gateway address and matches cactiuser@'%', not cactiuser@localhost.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pin integration tests to Cacti 1.2.31

2 participants